import { fileSizeSort, timeSort } from '@/utils/sizeSort';

export const userManageType = [
  { name: '头像', type: 'headerImg', isSlot: true, width: 100 },
  { name: '用户名', type: 'username' },
  { name: '昵称', type: 'nickName', width: 160 },
  { name: '手机号', type: 'phone', width: 120 },
  { name: '邮箱', type: 'email', width: 160 },
  { name: '角色名称', type: 'roleName', width: 120 },
  { name: '多点登录', type: 'multipoint', isSlot: true, width: 100 },
  { name: '启用状态', type: 'enable', isSlot: true, width: 100 },
];

export const roleManageType = [
  // { name: '角色ID', type: 'roleId' },
  { name: '角色名称', type: 'roleName' },
];

export const configManageType = [
  { name: '配置项', type: 'label' },
  { name: 'Key', type: 'k' },
  { name: 'Value', type: 'v' },
];

export const componentType = [
  { name: '名称', type: 'name' },
  { name: '图标', type: 'icon', isSlot: true },
  { name: '类型', type: 'kindName' },
  { name: '分类', type: 'categoryName' },
  { name: '配置', type: 'config' },
  { name: '操作系统', type: 'systemType', isSlot: true },
  { name: '所在节点', type: 'computerNames', isSlot: true },
  { name: '镜像大小', type: 'size' },
  { name: '任务状态', type: 'task', isSlot: true },
];
export const sceneType = [
  { name: '名称', type: 'name' },
  { name: '封面', type: 'cover', isSlot: true },
  { name: '行业', type: 'sceneType', width: 120 },
  { name: '组件数', type: 'componentNum', width: 100 },
  { name: '网络数', type: 'networkNum', width: 100 },
  { name: '是否可用', type: 'available', isSlot: true, width: 100 },
  { name: '状态', type: 'status', isSlot: true, width: 100 },
  { name: '任务状态', type: 'task', isSlot: true, width: 100 },
];
export const vmWareManageType = [
  { name: '虚拟机ID', type: 'KvmID', width: 80 },
  { name: '名称', type: 'name' },
  { name: '镜像/靶标', type: 'baseImageName' },
  { name: 'CPU核心数', type: 'cores', width: 100 },
  { name: '内存(M)', type: 'memory', width: 80 },
  { name: '硬盘(G)', type: 'storage', width: 80 },
  { name: '操作系统', type: 'baseImageSystemType', isSlot: true, width: 80 },
  { name: '所在集群', type: 'cluster', isSlot: true, width: 80 },
  { name: '所在节点', type: 'computer', isSlot: true, width: 100 },
  { name: '状态', type: 'status', isSlot: true, width: 80 },
  { name: '任务状态', type: 'task', isSlot: true, width: 80 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
  // { name: '电源', type: 'power', isSlot: true },
];

// 集群列表-虚拟机管理
export const clusterByVmType = [
  { name: '虚拟机ID', type: 'kvmID', width: 140 },
  { name: '名称', type: 'name', width: 240 },
  { name: '镜像/靶标', type: 'baseImageName', width: 180 },
  { name: 'CPU核心数', type: 'cores', width: 160, sortBy: 'number' },
  { name: '内存(M)', type: 'memory', width: 120, sortBy: 'number' },
  { name: '硬盘(G)', type: 'storage', width: 120, sortBy: 'number' },
  { name: '操作系统', type: 'baseImageSystemType', isSlot: true, width: 140 },
  { name: '所在计算节点', type: 'computerName', isSlot: true, width: 160 },
  { name: '所属场景', type: 'sceneName', width: 140 },
  { name: '状态', type: 'status', isSlot: true, width: 120 },
  { name: '任务状态', type: 'taskStatus', isSlot: true, width: 140 },
];

// 计算节点列表-虚拟机管理
export const computeNodeByVmType = [
  { name: '虚拟机ID', type: 'kvmID', width: 140 },
  { name: '名称', type: 'name', width: 240 },
  { name: '镜像/靶标', type: 'baseImageName', width: 180 },
  { name: 'CPU核心数', type: 'cores', width: 160, sortBy: 'number' },
  { name: '内存(M)', type: 'memory', width: 120, sortBy: 'number' },
  { name: '硬盘(G)', type: 'storage', width: 120, sortBy: 'number' },
  { name: '操作系统', type: 'baseImageSystemType', isSlot: true, width: 140 },
  { name: '所属场景', type: 'sceneName', width: 140 },
  { name: '状态', type: 'status', isSlot: true, width: 120 },
  { name: '任务状态', type: 'taskStatus', isSlot: true, width: 140 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 集群-docker管理
export const clusterByDocker = [
  { name: '容器ID', type: 'containerID', width: 120, isSlot: true },
  { name: '名称', type: 'name', width: 240 },
  { name: '镜像/靶标', type: 'baseImageName', width: 180 },
  { name: 'CPU核心数', type: 'nanoCPUs', width: 120, sortBy: 'number' },
  { name: '内存(M)', type: 'memory', width: 100, sortBy: 'number' },
  { name: '所在计算节点', type: 'computerName', isSlot: true, width: 140 },
  { name: '所属场景', type: 'sceneName', width: 100 },
  { name: '状态', type: 'status', isSlot: true, width: 80 },
];

// 计算节点-docker管理
export const computeNodeByDocker = [
  { name: '容器ID', type: 'containerID', width: 120, isSlot: true },
  { name: '名称', type: 'name', width: 240 },
  { name: '镜像/靶标', type: 'baseImageName', width: 180 },
  { name: 'CPU核心数', type: 'nanoCPUs', width: 120, sortBy: 'number' },
  { name: '内存(M)', type: 'memory', width: 100, sortBy: 'number' },
  { name: '所属场景', type: 'sceneName', width: 100 },
  { name: '状态', type: 'status', isSlot: true, width: 80 },
];

// 集群列表-沙箱网络
export const clusterBySandbox = [
  { name: '网桥名称', type: 'nickName' },
  { name: '接口数量', type: 'interfaceCount', width: 100, sortBy: 'number' },
  { name: 'DHCP状态', type: 'isDHCP', isSlot: true, width: 120 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
  { name: '所属计算节点', type: 'computerName', width: 200 },
  { name: '所属场景', type: 'sceneName', width: 140 },
  { name: '描述', type: 'desc' },
];

// 计算节点列表-沙箱网络
export const computeNodeBySandbox = [
  { name: '网桥名称', type: 'nickName' },
  { name: '接口数量', type: 'interfaceCount', width: 100, sortBy: 'number' },
  { name: 'DHCP状态', type: 'isDHCP', isSlot: true, width: 120 },
  { name: '所属场景', type: 'sceneName', width: 140 },
  { name: '描述', type: 'desc' },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 集群列表-VPC网络
export const clusterByVpc = [
  { name: '设备ID', type: 'ID', width: 100 },
  { name: '网络名称', type: 'name' },
  { name: '接口数量', type: 'interfaceCount', width: 100, sortBy: 'number' },
  { name: '描述', type: 'desc' },
  { name: '所属计算节点', type: 'computerName', width: 140 },
  { name: '所属场景', type: 'sceneName', width: 100 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 计算节点列表-VPC网络
export const computeNodeByVpc = [
  { name: '设备ID', type: 'ID', width: 100 },
  { name: '网络名称', type: 'name' },
  { name: '接口数量', type: 'interfaceCount', width: 100, sortBy: 'number' },
  { name: '描述', type: 'desc' },
  { name: '所属场景', type: 'sceneName', width: 100 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 网络-虚拟机管理
export const networkByVmware = [
  { name: '网络类型', type: 'ipAllocationMode', isSlot: true },
  { name: 'IP(ipv4)', type: 'ipV4', isSlot: true },
  { name: 'Mac', type: 'mac', width: 200 },
  { name: '网关', type: 'ipV4Gateway', isSlot: true },
  { name: '桥接类型', type: 'conType', isSlot: true },
  { name: '桥接网桥', type: 'networkName', isSlot: true, width: 140 },
  { name: 'vlan', type: 'tag', isSlot: true, width: 100, sortBy: 'number' },
];

// 接口-沙箱网络
export const apiConfigBySandbox = [
  { name: '网卡名称', type: 'name' },
  { name: '对端实例名称', type: 'targetInstanceName', width: 150 },
  { name: '对端端口名称', type: 'targetInstancePort', width: 150 },
  { name: 'vlan', type: 'tags', width: 100, sortBy: 'number' },
  { name: '对端IP', type: 'targetInstanceIP', width: 160 },
  { name: '对端MAC', type: 'targetInstanceMac', width: 160 },
  { name: '对端网关', type: 'targetInstanceIpV4Gateway', width: 160 },
];

// DHCP-沙箱网络
export const DHCPBySandbox = [
  { name: '名称', type: 'KvmID' },
  { name: '集群网络', type: 'name', width: 120 },
  { name: '服务IP/MASK', type: 'cores', width: 160 },
  { name: '地址池开始地址', type: 'cores', width: 160 },
  { name: '地址池结束地址', type: 'cores', width: 160 },
  { name: '状态', type: 'name', width: 120 },
  { name: '任务状态', type: 'name', width: 120 },
];

// 流规则-沙箱网络
export const flowRuleBySandbox = [
  { name: '协议', type: 'protocol' },
  { name: '优先级', type: 'priority' },
  { name: '源IP', type: 'sourceIP' },
  { name: '目的IP', type: 'destinationIP' },
  { name: '源MAC', type: 'sourceMAC' },
  { name: '目的MAC', type: 'destinationMAC' },
  { name: '动作', type: 'action', isSlot: true },
];

// 路由配置-VPC网络
export const routeConfigByVpc = [
  { name: 'IP地址/掩码', type: 'ipv4', width: 160 },
  { name: '下一跳/接口', type: 'next' },
  { name: '距离', type: 'metric', width: 160 },
];

// 生效路由表-VPC网络
export const effectRouteByVpc = [
  { name: '目的地址', type: 'destination', width: 160 },
  { name: '下一跳/接口', type: 'gateway' },
  { name: '标记', type: 'flags', width: 80 },
  { name: '网络掩码', type: 'genmask', width: 200 },
  { name: '路由距离', type: 'metric', width: 160 },
  { name: '输出接口', type: 'iface', width: 120 },
];

// 接口-VPC网络
export const apiConfigByVPC = [
  { name: '网卡名称', type: 'name', width: 160 },
  { name: '网卡状态', type: 'status', width: 140, isSlot: true },
  { name: '网络类型', type: 'ipAllocationMode', width: 140, isSlot: true },
  { name: '网桥名称', type: 'virName', width: 140 },
  { name: 'vlan', type: 'vlanTag', width: 100, sortBy: 'number' },
  { name: 'IP(ipV4)', type: 'ipV4', width: 160, isSlot: true },
  { name: 'MAC', type: 'mac', width: 160 },
  { name: '网关', type: 'ipV4Gateway', width: 160 },
  { name: '桥接类型', type: 'conType', width: 140, isSlot: true },
  { name: '桥接网络', type: 'networkName', width: 180, isSlot: true },
];

// 桥接网络
export const networkBySandbox = [
  { name: '名称', type: 'name' },
  { name: '状态', type: 'status', isSlot: true },
  { name: '描述', type: 'desc' },
  { name: '桥接类型', type: 'conType', isSlot: true },
  { name: '桥接网络', type: 'networkName', width: 140 },
];

// DHCP-VPC网络
export const DHCPConfigByVpc = [
  { name: 'DHCP服务器IP/MASK', type: 'ip' },
  { name: '地址池开始地址', type: 'ipStart' },
  { name: '地址池结束地址', type: 'ipEnd' },
  { name: 'Vlan', type: 'tag', sortBy: 'number' },
];

// 防火墙-访问控制-VPC网络
export const accessControlByVpc = [
  { name: '源地址', type: 's_addr' },
  { name: '目的地址', type: 'd_addr', width: 120 },
  { name: '协议', type: 'protocol' },
  { name: '目的端口', type: 'd_port', width: 120 },
  { name: '流入接口', type: 'in_eth', width: 120 },
  { name: '流出接口', type: 'out_eth', width: 120 },
  { name: '动作', type: 'action' },
  { name: '命中数', type: 'pkts' },
  { name: '命中字节', type: 'bytes', width: 120 },
];

// 防火墙-源Nat-VPC网络
export const sourceNatByVpc = [
  { name: '源地址', type: 's_addr' },
  { name: '目的地址', type: 'd_addr', width: 120 },
  { name: '协议', type: 'protocol' },
  { name: '目的端口', type: 'd_port', width: 120 },
  { name: '类型', type: 'action', isSlot: true },
  { name: '转化对象', type: 'to_object', width: 120 },
  { name: '命中数', type: 'pkts' },
  { name: '命中字节', type: 'bytes', width: 120 },
];

// 防火墙-端口映射-VPC网络
export const portMappingByVpc = [
  { name: '协议', type: 'protocol' },
  { name: '外网端口', type: 'out_port' },
  { name: '内网IP', type: 'in_ip' },
  { name: '内网端口', type: 'in_port' },
  { name: '命中数', type: 'pkts' },
  { name: '命中字节', type: 'bytes' },
];

// 防火墙-入站策略-VPC网络
export const inboundStrategyByVpc = [
  { name: '源地址', type: 's_addr' },
  { name: '目的地址', type: 'd_addr', width: 120 },
  { name: '协议', type: 'protocol' },
  { name: '目的端口', type: 'd_port', width: 120 },
  { name: '流入接口', type: 'in_eth', width: 120 },
  { name: '动作', type: 'action' },
  { name: '命中数', type: 'pkts' },
  { name: '命中字节', type: 'bytes', width: 120 },
];

export const vmWareStatusMap = {
  0: { name: '未生成', type: 'info' },
  1: { name: '运行中', type: 'success' },
  2: { name: '停止', type: 'danger' },
  3: { name: '创建中', type: 'info' },
  4: { name: '开启中', type: 'warning' },
  5: { name: '关闭中', type: 'warning' },
};
export const vmNetWorkType = [
  { name: '网络类型', type: 'ipAllocationMode', isSlot: true },
  { name: '桥接网络', type: 'clusterNetworkName', isSlot: true },
  { name: 'IP(ipv4)', type: 'ipV4', isSlot: true },
  { name: 'Mac', type: 'mac', width: 200 },
  { name: '网关', type: 'ipV4Gateway', isSlot: true },
];

export const dockerManageType = [
  { name: '容器ID', type: 'containerID', width: 120, isSlot: true },
  { name: '名称', type: 'name', width: 120 },
  { name: '镜像/靶标', type: 'baseImageName' },
  { name: 'CPU核心数', type: 'nanoCPUs', width: 100 },
  { name: '内存(M)', type: 'memory', width: 80 },
  { name: '所在集群', type: 'cluster', isSlot: true, width: 100 },
  { name: '所在节点', type: 'computer', isSlot: true, width: 100 },
  { name: '状态', type: 'status', isSlot: true, width: 80 },
  { name: '任务状态', type: 'task', isSlot: true, width: 100 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

export const taskManageType = [
  { name: '描述', type: 'name' },
  { name: '进度', type: 'progress', isSlot: true, width: 140 },
  { name: '状态', type: 'status', isSlot: true, width: 100 },
  { name: '提示信息', type: 'message', width: 140 },
  { name: '开始时间', type: 'start_time', isSlot: true, width: 140 },
  { name: '结束时间', type: 'end_time', isSlot: true, width: 140 },
  { name: '耗时', type: 'time', width: 120, isCallback: timeSort },
];
export const taskDetailType = [
  // { name: '任务ID', type: 'ID' },
  // { name: 'UUID', type: 'uuid' },
  { name: '描述', type: 'name' },
  { name: '进度', type: 'progress', isSlot: true },
  { name: '状态', type: 'status', isSlot: true },
  { name: '提示信息', type: 'message' },
  { name: '创建时间', type: 'CreatedAt', isSlot: true },
  { name: '执行时长', type: 'time', isSlot: true },
  { name: '开始时间', type: 'start_time', isSlot: true },
  { name: '结束时间', type: 'end_time', isSlot: true },
  { name: '子任务', type: 'children' },
];
export const taskStatusType = {
  0: { name: '未开始', type: 'info' },
  1: { name: '进行中', type: '' },
  2: { name: '错误终止', type: 'danger' },
  3: { name: '已完成', type: 'success' },
};

export const dhcpServerType = [
  { name: '名称', type: 'name' },
  { name: '关联集群网络', type: 'ClusterNetwork.name' },
  { name: '服务IP/MASK', type: 'ip', isSlot: true },
  { name: '地址池开始地址', type: 'ipStart', isSlot: true },
  { name: '地址池结束地址', type: 'ipEnd', isSlot: true },
  { name: '状态', type: 'status', isSlot: true },
  { name: '任务状态', type: 'task', isSlot: true },
];

export const dhcpStatusMap = {
  0: { name: '未开始', type: 'info' },
  2: { name: '错误终止', type: 'danger' },
  3: { name: '结束完成', type: 'success' },
};

export const AuditLogType = [
  { name: '操作描述', type: 'description', width: 240 },
  { name: '模块', type: 'module', width: 240 },
  { name: '结果', type: 'result', isSlot: true, width: 100 },
  { name: '用户', type: 'nickName', width: 120 },
  { name: '客户端IP', type: 'clientIP', width: 120 },
  { name: '时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

export const toolSetType = [
  { name: '名称', type: 'name', width: '200px' },
  { name: '版本', type: 'version', width: '200px' },
  { name: '实例数量', type: 'instanceCount', width: '200px' },
  { name: '状态', type: 'status', width: '200px', isSlot: true },
  { name: '工具大小', type: 'sizeFormat', width: '200px' },
  { name: '时间', type: 'CreatedAt', isSlot: true },
];

export const toolInstanceSetType = [
  { name: '容器ID', type: 'containerID', isSlot: true },
  { name: '关联工具', type: 'tool.name', width: '200px' },
  { name: '关联项目', type: 'project.name', width: '200px' },
  { name: '所在节点', type: 'computer.name', width: '200px' },
  { name: '版本', type: 'version', isSlot: true },
  { name: '状态', type: 'statusDesc' },
];

export const sceneResearchProjectManage = [
  { name: '名称', type: 'name', width: '200px' },
  { name: '关联场景', type: 'scene.name', width: '200px' },
  { name: '开始时间', type: 'startTime', width: '200px', isSlot: true },
  { name: '结束时间', type: 'endTime', width: '200px', isSlot: true },
  { name: '运行次数', type: 'runNum' },
  { name: '状态', type: 'statusDesc', isSlot: true },
];

export const toolTaskType = [
  { name: '关联工具', type: 'toolName', width: '200px' },
  { name: '关联项目', type: 'projectName', width: '200px' },
  { name: '工具版本', type: 'version', width: '200px' },
  { name: '状态', type: 'status', width: '200px', isSlot: true },
  { name: '任务信息', type: 'message' },
];

export const sceneResearchSpecialProjectManage = [
  { name: '名称', type: 'name', width: '300px' },
  { name: '步骤数', type: 'step_num', width: '300px' },
  { name: '任务数', type: 'task_num', width: '300px' },
  { name: '创建时间', type: 'CreatedAt', isSlot: true },
];

// defaultDate 数据库中的时间，默认的空值
export const defaultDate = '0001-01-01T00:00:00Z';

export const interNodeType = [
  { name: '装置名称', type: 'name' },
  { name: '管理IP', type: 'manageIP' },
  { name: '装置序列号', type: 'uuid' },
  { name: '中心节点', type: 'centerNode' },
  { name: '在线状态', type: 'status', isSlot: true },
  { name: '资产数', type: 'assetNum' },
  { name: '所在集群', type: 'clusterName' },
  { name: '创建时间', type: 'createdAt', isSlot: true },
];

export const interNodeIfaceType = [
  { name: '创建时间', type: 'createdAt', isSlot: true },
  { name: '名称', type: 'name' },
  { name: 'IP', type: 'ipv4' },
  { name: 'MAC', type: 'mac' },
];

export const interNodeFireType = [
  { name: '创建时间', type: 'createdAt', isSlot: true },
  { name: '动作', type: 'action' },
  { name: '源地址', type: 's_addr' },
  { name: '目的地址', type: 'd_addr' },
  { name: '协议', type: 'protocol' },
  { name: '目的端口', type: 'd_port' },
  { name: '流入接口', type: 'in_eth' },
  { name: '命中数', type: 'pkts' },
  { name: '命中字节', type: 'bytes' },
];

export const interNodeIPSecType = [
  { name: '创建时间', type: 'createdAt', isSlot: true },
  { name: '名称', type: 'saName' },
  { name: '对端网关', type: 'remote-host' },
  { name: '本地网关', type: 'local-host' },
  { name: '状态', type: 'state', isSlot: true },
  { name: '源网络', type: 'local-ts' },
  { name: '目的网络', type: 'remote-ts' },
  { name: '流量(入/出)', type: 'bytes-in' },
  { name: 'IKE模式', type: 'version' },
];

export const localMaterialType = [
  { name: '名称', type: 'name' },
  { name: '图标', type: 'icon', isSlot: true },
  { name: 'MAC', type: 'mac' },
  { name: 'IP', type: 'IPv4' },
  { name: '在线状态', type: 'status', isSlot: true },
  { name: '管理协议', type: 'agreement' },
  { name: '分类', type: 'category', isSlot: true },
  { name: '所在属互联装置', type: 'device', isSlot: true },
  { name: '创建时间', type: 'createdAt', isSlot: true },
];

export const remoteMaterialType = [
  { name: '名称', type: 'name' },
  { name: '图标', type: 'icon', isSlot: true },
  { name: 'MAC', type: 'mac' },
  { name: 'IP', type: 'IPv4' },
  { name: '在线状态', type: 'status', isSlot: true },
  // { name: '管理协议', type: 'agreement' },
  { name: '分类', type: 'category', isSlot: true },
  { name: '中心节点', type: 'centerNode', isSlot: true },
  { name: '所属装置', type: 'remoteInterconnection' },
  {
    name: '本地装置',
    comment:
      '该字段说明远程实物所在的互联装置，是通过关联的本地装置扫描所在控制中心下的远程互联装置得到。与本地实物相连时，只可以和关联的本地装置下的本地实物连接。',
    type: 'localInterconnection',
    isSlot: true,
  },
  { name: '创建时间', type: 'createdAt', isSlot: true },
];

export const remoteNodeType = [
  { name: '装置名称', type: 'name' },
  { name: 'WAN IP', type: 'IPv4Inner' },
  { name: '装置序列号', type: 'UUID' },
  { name: '中心节点', type: 'code' },
  { name: '在线状态', type: 'status', isSlot: true },
  { name: '资产数', type: 'assetNum' },
  { name: '创建时间', type: 'createdAt', isSlot: true },
];

export const sceneCopyType = [
  // { name: '应用标识', type: 'app'},
  // { name: '用户标识', type: 'user' },
  { name: '副本名称', type: 'name', width: 220 },
  { name: '场景', type: 'scene', width: 180 },
  { name: '版本', type: 'version', width: 120 },
  { name: '标签', type: 'labelName', isSlot: true, width: 140 },
  { name: '运行组件/组件总数', type: 'componentNum', width: 160 },
  { name: '克隆时间', type: 'CreatedAt', isSlot: true, width: 160 },
  { name: '占用状态', type: 'isOccupy', isSlot: true, width: 140 },
  { name: '任务状态', type: 'taskStatus', isSlot: true, width: 140 },
];

// 靶标连接
export const linkComponentList = [
  { name: '设备名称', type: 'name' },
  { name: 'IP地址', type: 'ip', width: 180 },
  { name: '连接方式', type: 'type', width: 120, isSlot: true },
  { name: '端口', type: 'port', width: 100 },
  { name: '时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

export const linkDeviceList = [
  { name: '名称', type: 'name' },
  { name: '管理地址', type: 'host', width: 180 },
  { name: '在线状态', type: 'status', isSlot: true, width: 120 },
  { name: '初始化配置', type: 'isConfig', isSlot: true, width: 120 },
  { name: '端口数量', type: 'interfaceNum', width: 100, sortBy: 'number' },
  { name: '所在集群', type: 'clusterName', width: 100 },
  { name: '任务状态', type: 'task', isSlot: true, width: 100 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 物理设备
export const realDeviceList = [
  { name: '名称', type: 'name' },
  { name: '管理IP', type: 'host', width: 150 },
  { name: '端口数量', type: 'interfaceNum', width: 100, sortBy: 'number' },
  { name: '图标', type: 'icon', isSlot: true, width: 100 },
  { name: '接入设备', type: 'linkEquipmentName', width: 180 },
  { name: '分类', type: 'categoryName', width: 100 },
  { name: '业务口IP', type: 'interfaces', isSlot: true, width: 180 },
  { name: '在线状态', type: 'status', isSlot: true, width: 100 },
  { name: '接入方式', type: 'kind', isSlot: true, width: 120 },
  { name: '接入模式', type: 'type', isSlot: true, width: 120 },
];

// 流量仿真
export const trafficSimulationList = [
  { name: '名称', type: 'name' },
  // { name: '类型', type: 'typeName' },
  { name: '攻击分类', type: 'categoryName', isSlot: true },
  { name: '源地址', type: 'sourceIP' },
  { name: '目的地址', type: 'destIP' },
  // { name: '源端口范围', type: 'sourcePortRange' },
  { name: '目的端口范围', type: 'destPortRange' },
  // { name: '每个请求超时时间', type: 'timeOut' },
  { name: '请求总次数', type: 'count', width: 90 },
  { name: '请求总时长', type: 'allTime', width: 90 },
  { name: '上次生成时间', type: 'generateTime', isSlot: true },
  { name: '生成次数', type: 'generateCount', width: 80 },
  { name: '文件大小', type: 'fileSize', width: 100, sortBy: fileSizeSort },
  { name: '状态', type: 'status', isSlot: true, width: 100 },
  { name: '任务状态', type: 'task', isSlot: true },
];

// 复盘管理
export const playbackManage = [
  { name: '名称', type: 'name' },
  { name: '复盘场景/副本', type: 'typeName', width: 140 },
  { name: '复盘时间段', type: 'time', width: 320, isSlot: true },
  { name: '复盘当前时间', type: 'playbackTime', width: 160 },
  { name: '进度条', type: 'progress', isSlot: true, width: 320 },
  { name: '复盘倍速', type: 'rate', width: 100 },
];

/**
 * 系统配置
 * @type {[{name: string, type: string},{name: string, type: string},{isSlot: boolean, name: string, type: string}]}
 */
export const systemSetList = [
  { name: '配置名称', type: 'name', width: 140 },
  { name: '系统标签名称', type: 'title', width: 140 },
  { name: '系统标签icon', type: 'favicon', isSlot: true, width: 140 },
  { name: '系统logo', type: 'logo', isSlot: true, width: 320 },
  { name: '系统小logo', type: 'smalllogo', isSlot: true, width: 120 },
  { name: '系统版权信息', type: 'footer', width: 160 },
  { name: '是否启用', type: 'isUsed', isSlot: true, width: 100 },
];

// 快照管理
export const snapshotList = [
  { name: '名称', type: 'name' },
  { name: 'cpu', type: 'cores', width: 180 },
  { name: '内存', type: 'memory', width: 120 },
  { name: '状态', type: 'isRunning', width: 100, isSlot: true },
  { name: '简介', type: 'description', width: 120 },
  { name: '创建时间', type: 'CreatedAt', isSlot: true, width: 160 },
];

// 攻击路径
export const attackPathList = [
  { name: '名称', type: 'name', width: 160 },
  { name: '开始节点', type: 'sourceInstanceName', width: 140 },
  { name: '结束节点', type: 'targetInstanceName', width: 140 },
  { name: '路径', type: 'path', isSlot: true },
];

// 存储管理-节点管理
export const nodeManageByStorage = [
  { name: '节点名称', type: 'name' },
  { name: '管理网IP', type: 'ipManager' },
  { name: '存储网IP', type: 'ipStorage' },
  { name: '状态', type: 'status', isSlot: true },
  { name: '更新时间', type: 'UpdatedAt', isSlot: true },
];

//  存储管理-节点管理-查看块信息
export const nodeManageRelateBlockByStorage = [
  { name: '关联存储路径', type: 'path' },
  { name: '关联卷', type: 'storageVolumeName' },
  { name: '容量', type: 'size', isSlot: true },
  { name: '状态', type: 'status', isSlot: true },
];

// 存储管理-卷管理
export const rollManageByStorage = [
  { name: '名称', type: 'name' },
  { name: '卷名称', type: 'poolName' },
  { name: '卷类型', type: 'category', isSlot: true },
  { name: '存储路径数量', type: 'brickCount' },
  { name: '容量', type: 'size', isSlot: true },
  { name: '状态', type: 'status', isSlot: true },
  { name: '更新时间', type: 'UpdatedAt', isSlot: true },
];

//  存储管理-卷管理-查看块信息
export const rollManageRelateNodeByStorage = [
  { name: '关联节点', type: 'storageNodeName' },
  { name: '关联存储路径', type: 'path' },
  { name: '容量', type: 'size', isSlot: true },
  { name: '状态', type: 'status', isSlot: true },
];

// 存储管理-挂载管理
export const mountManageByStorage = [
  { name: '计算节点', type: 'computerName' },
  { name: '挂载点', type: 'path' },
  { name: '挂载卷', type: 'storageVolumeName' },
  { name: '状态', type: 'status', isSlot: true },
];

// 计算节点-镜像资源
export const nodeManageImagesResource = [
  { type: 'component.name', name: '名称', width: 140 },
  {
    type: 'systemType',
    name: '操作系统类型',
    isSlot: true,
    width: 140,
  },
  { type: 'component.path', name: '存储位置', width: 260 },
  {
    type: 'componentNum',
    name: '实例数量',
    isSlot: true,
    width: 140,
  },
  { type: 'syncStatus', name: '同步状态', isSlot: true, width: 140 },
  {
    type: 'UpdatedAt',
    name: '更新时间',
    isSlot: true,
    width: 160,
  },
];

/**
 * 处理logo配置图片
 * @param url
 * @returns {string}
 */
export const handleLogoCover = url => {
  const env = import.meta.env.MODE;
  if (url) {
    if (DATA_INFO.isSso) {
      url = '/api/topo/general/static/' + url;
    } else {
      url =
        env === 'development'
          ? '/simulation/static/' + url
          : '/api/topo/simulation/static/' + url;
    }
  } else {
    url = '';
  }

  return url;
};

export const simulationCover = url => {
  const env = import.meta.env.MODE;
  if (url) {
    url =
      env === 'development'
        ? url
        : '/api/topo/simulation/static/' + url;
  } else {
    url = '';
  }

  return url;
};
